home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE03 / TYPECAST / MATHSU.PAS < prev    next >
Pascal/Delphi Source File  |  1995-07-08  |  726b  |  44 lines

  1. unit Mathsu;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Spin;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Op1: TSpinEdit;
  12.     Op2: TSpinEdit;
  13.     Res: TSpinEdit;
  14.     Label1: TLabel;
  15.     Label2: TLabel;
  16.     procedure OpChange(Sender: TObject);
  17.   private
  18.     { Private declarations }
  19.   public
  20.     { Public declarations }
  21.   end;
  22.  
  23. var
  24.   Form1: TForm1;
  25.  
  26. implementation
  27.  
  28. {$R *.DFM}
  29.  
  30. procedure TForm1.OpChange(Sender: TObject);
  31. var
  32.   Num1, Num2: Word;
  33.   Num3: Longint;
  34. begin
  35.   if (Op1.Text = '') or (Op2.Text = '') then
  36.     Exit;
  37.   Num1 := Op1.Value;
  38.   Num2 := Op2.Value;
  39.   Num3 := Num1 * Num2;
  40.   Res.Value := Num3;
  41. end;
  42.  
  43. end.
  44.